import request from '@/utils/request'

// 查询合作关系列表
export function listCooperations(query) {
  return request({
    url: '/api/supplier/cooperation/list',
    method: 'get',
    params: query
  })
}

// 根据供应商ID查询合作关系
export function getCooperationsBySupplierId(supplierId) {
  return request({
    url: '/api/supplier/cooperation/supplier/' + supplierId,
    method: 'get'
  })
}

// 查询合作关系详细
export function getCooperation(cooperationId) {
  return request({
    url: '/api/supplier/cooperation/' + cooperationId,
    method: 'get'
  })
}

// 新增合作关系
export function addCooperation(data) {
  return request({
    url: '/api/supplier/cooperation',
    method: 'post',
    data: data
  })
}

// 修改合作关系
export function updateCooperation(data) {
  return request({
    url: '/api/supplier/cooperation',
    method: 'put',
    data: data
  })
}

// 删除合作关系
export function deleteCooperation(cooperationId) {
  return request({
    url: '/api/supplier/cooperation/' + cooperationId,
    method: 'delete'
  })
}
